import Phaser from 'https://gitee.com/kiraking/ghl/raw/master/src/lib/phaser.js'

export default class Openning extends Phaser.Scene
{
    title

    constructor()
	{
		super('openning')
	}

	

	preload()
	{
		this.load.audio('start_sound', 'assets/sfx/start_sound.mp3')

		this.load.image('title', 'assets/openning/title.png')
		this.load.image('start', 'assets/openning/start.png')
	}

	create()
	{

		
		const { height, width } = this.game.config;


		this.start_sound = this.sound.add('start_sound', { volume: 0.2 });

		this.title = this.add.image(width/2, height/2, 'title').setScale(1.5);

		this.start = this.add.image(width/2, height/2 + 200, 'start')
		.setScale(1.5)
		.setInteractive();
		this.start.on('pointerdown', () => { 
			this.scene.start('choose');
			this.start_sound.play();
		})

		this.initAnims();

	}

	initAnims() {
		
	}

    update()
	{

    }
}